<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>ESP8266_RTOS_SDK: AirKiss APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266_RTOS_SDK
   &#160;<span id="projectnumber">v1.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">AirKiss APIs<div class="ingroups"><a class="el" href="group__WiFi__APIs.html">WiFi Related APIs</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>AirKiss APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaa0ebed8b87dd27c1c1d80c316fe2e691"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__AirKiss__APIs.html#gaa0ebed8b87dd27c1c1d80c316fe2e691">airkiss_lan_ret_t</a> { <br />
&#160;&#160;<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691a3eec80987fe47f20344931bf4afeb4e4">AIRKISS_LAN_ERR_OVERFLOW</a> = -5, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691a30641c2d4b8fee854a90861f957c5923">AIRKISS_LAN_ERR_CMD</a> = -4, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691aa48241b150e73210e45c81aa9b76137f">AIRKISS_LAN_ERR_PAKE</a> = -3, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691ae4043da2985abd40a90fd198fd607622">AIRKISS_LAN_ERR_PARA</a> = -2, 
<br />
&#160;&#160;<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691a14bf764748a58af181c316c2e2ee5322">AIRKISS_LAN_ERR_PKG</a> = -1, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691a6c669d0e28f90ea37e6aea8f9084c0d1">AIRKISS_LAN_CONTINUE</a> = 0, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691aad38be677ab42b9f59e773c456695b02">AIRKISS_LAN_SSDP_REQ</a> = 1, 
<a class="el" href="group__AirKiss__APIs.html#ggaa0ebed8b87dd27c1c1d80c316fe2e691a5743b4699a34a902a43540149ef380fb">AIRKISS_LAN_PAKE_READY</a> = 2
<br />
 }<tr class="separator:gaa0ebed8b87dd27c1c1d80c316fe2e691"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:gade31a70d11c8be30fcadd30bd7459cd1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gade31a70d11c8be30fcadd30bd7459cd1"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>airkiss_lan_cmdid_t</b> { <b>AIRKISS_LAN_SSDP_REQ_CMD</b> = 0x1, 
<b>AIRKISS_LAN_SSDP_RESP_CMD</b> = 0x1001, 
<b>AIRKISS_LAN_SSDP_NOTIFY_CMD</b> = 0x1002
 }<tr class="separator:gade31a70d11c8be30fcadd30bd7459cd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad2485fae7edd33913a96ae91fd277acd"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__AirKiss__APIs.html#gad2485fae7edd33913a96ae91fd277acd">airkiss_version</a> (void)</td></tr>
<tr class="memdesc:gad2485fae7edd33913a96ae91fd277acd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the version information of AirKiss lib.  <a href="#gad2485fae7edd33913a96ae91fd277acd">More...</a><br /></td></tr>
<tr class="separator:gad2485fae7edd33913a96ae91fd277acd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7545a7e75de00da0b22c232de602e092"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__AirKiss__APIs.html#ga7545a7e75de00da0b22c232de602e092">airkiss_lan_recv</a> (const void *body, unsigned short length, const <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a> *config)</td></tr>
<tr class="memdesc:ga7545a7e75de00da0b22c232de602e092"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse the UDP packet sent by AirKiss.  <a href="#ga7545a7e75de00da0b22c232de602e092">More...</a><br /></td></tr>
<tr class="separator:ga7545a7e75de00da0b22c232de602e092"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab6bab3b00620928bca5e2adc0d2abd31"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__AirKiss__APIs.html#gab6bab3b00620928bca5e2adc0d2abd31">airkiss_lan_pack</a> (airkiss_lan_cmdid_t ak_lan_cmdid, void *appid, void *deviceid, void *_datain, unsigned short inlength, void *_dataout, unsigned short *outlength, const <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a> *config)</td></tr>
<tr class="memdesc:gab6bab3b00620928bca5e2adc0d2abd31"><td class="mdescLeft">&#160;</td><td class="mdescRight">Packaging the UDP packet.  <a href="#gab6bab3b00620928bca5e2adc0d2abd31">More...</a><br /></td></tr>
<tr class="separator:gab6bab3b00620928bca5e2adc0d2abd31"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>AirKiss APIs. </p>
<p>API airkiss_lan_recv and airkiss_lan_pack are provided for the function that AirKiss can detect the ESP8266 devices in LAN, more details about AirKiss please refer to WeChat : <a href="http://iot.weixin.qq.com">http://iot.weixin.qq.com</a>.</p>
<p>Workflow : Create a UDP transmission. When UDP data is received, call API airkiss_lan_recv and input the UDP data, if the airkiss_lan_recv returns AIRKISS_LAN_SSDP_REQ, airkiss_lan_pack can be called to make a response packet. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gaa0ebed8b87dd27c1c1d80c316fe2e691"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__AirKiss__APIs.html#gaa0ebed8b87dd27c1c1d80c316fe2e691">airkiss_lan_ret_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691a3eec80987fe47f20344931bf4afeb4e4"></a>AIRKISS_LAN_ERR_OVERFLOW&#160;</td><td class="fielddoc">
<p>the length of the data buffer is lack </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691a30641c2d4b8fee854a90861f957c5923"></a>AIRKISS_LAN_ERR_CMD&#160;</td><td class="fielddoc">
<p>Do not support the type of instruction </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691aa48241b150e73210e45c81aa9b76137f"></a>AIRKISS_LAN_ERR_PAKE&#160;</td><td class="fielddoc">
<p>Error reading data package </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691ae4043da2985abd40a90fd198fd607622"></a>AIRKISS_LAN_ERR_PARA&#160;</td><td class="fielddoc">
<p>Error function passing parameters </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691a14bf764748a58af181c316c2e2ee5322"></a>AIRKISS_LAN_ERR_PKG&#160;</td><td class="fielddoc">
<p>Packet data error </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691a6c669d0e28f90ea37e6aea8f9084c0d1"></a>AIRKISS_LAN_CONTINUE&#160;</td><td class="fielddoc">
<p>Message format is correct </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691aad38be677ab42b9f59e773c456695b02"></a>AIRKISS_LAN_SSDP_REQ&#160;</td><td class="fielddoc">
<p>Find equipment request packet is received </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggaa0ebed8b87dd27c1c1d80c316fe2e691a5743b4699a34a902a43540149ef380fb"></a>AIRKISS_LAN_PAKE_READY&#160;</td><td class="fielddoc">
<p>Packet packaging complete </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gab6bab3b00620928bca5e2adc0d2abd31"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int airkiss_lan_pack </td>
          <td>(</td>
          <td class="paramtype">airkiss_lan_cmdid_t&#160;</td>
          <td class="paramname"><em>ak_lan_cmdid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>appid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>deviceid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>_datain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>inlength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>_dataout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short *&#160;</td>
          <td class="paramname"><em>outlength</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Packaging the UDP packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">airkiss_lan_cmdid_t</td><td>ak_lan_cmdid : type of the packet. </td></tr>
    <tr><td class="paramname">void*</td><td>appid : Vendor's Wechat public number id, got from WeChat. </td></tr>
    <tr><td class="paramname">void*</td><td>deviceid : device model id, got from WeChat. </td></tr>
    <tr><td class="paramname">void*</td><td>_datain : user data waiting for packet assembly. </td></tr>
    <tr><td class="paramname">unsigned</td><td>short inlength : the lenth of user data. </td></tr>
    <tr><td class="paramname">void*</td><td>_dataout : data buffer addr, to store the packet got by _datain packet assembly. </td></tr>
    <tr><td class="paramname">unsigned</td><td>short* outlength : the size of data buffer. </td></tr>
    <tr><td class="paramname">const</td><td>airkiss_config_t* config : input struct <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>&gt;=0 : succeed (reference airkiss_lan_ret_t) </dd>
<dd>
&lt;0 : error code (reference airkiss_lan_ret_t) </dd></dl>

</div>
</div>
<a class="anchor" id="ga7545a7e75de00da0b22c232de602e092"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int airkiss_lan_recv </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>body</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse the UDP packet sent by AirKiss. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>void* body : the start of the UDP message body data pointer. </td></tr>
    <tr><td class="paramname">unsigned</td><td>short length : the effective length of data. </td></tr>
    <tr><td class="paramname">const</td><td>airkiss_config_t* config : input struct <a class="el" href="structairkiss__config__t.html">airkiss_config_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>&gt;=0 : succeed (reference airkiss_lan_ret_t) </dd>
<dd>
&lt;0 : error code (reference airkiss_lan_ret_t) </dd></dl>

</div>
</div>
<a class="anchor" id="gad2485fae7edd33913a96ae91fd277acd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* airkiss_version </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the version information of AirKiss lib. </p>
<dl class="section attention"><dt>Attention</dt><dd>The lenth of version is unknown</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the version information of AirKiss lib </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 1 2016 10:19:26 for ESP8266_RTOS_SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
